<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<script>
			//var s="abc";
			//s[2]="f";//不行
			//alert(s);
			//alert(s[2]);
			var s1="abcsldkfj3sldkfjsldasflsjfablsdkfj";
			var s2="ab";
			var index=0;
			var count=0;
			while((index=s1.indexOf(s2,index))!=-1){
				count++;
				index+=s2.length;
				//alert(index);
			}
			alert(count);
		</script>
	</head>
	<body>
	</body>
</html>
